package com.whq.thrift.api.common.constants;

import java.util.HashMap;
import java.util.Map;

/**
 * 常用的错误码（号段：-14001349  -14001250）
 * @author whq-mac
 *
 */
public class CommonErrorCodeConstants {
	public static final int ERR_CODE_SUCCESS = 0;
	public static final int ERR_CODE_LACK_PARAM = -14001250;
	public static final int ERR_CODE_THRIFT_RESPONSE_NULL = -14001251;
	public static final int ERR_CODE_THRIFT_INSTANCE_NULL = -14001252;
	public static final int ERR_CODE_INVOKE_THRIFT_SERVICE_ERROR = -14001253;
	public static final int ERR_CODE_PARAM_ILLEGAL = -14001254;
	public static final int ERR_CODE_CALL_SERVICE_METHOD_ERROR = -14001255;
	public static final int ERR_CODE_THRIFT_SERVICE_METHOD_NOT_EXIST = -14001256;
	public static final int ERR_CODE_PARSE_RESPONSE_ERROR = -14001257;
	public static final int ERR_CODE_PARSE_TICKET_ERROR = -14001258;
	public static final int ERR_CODE_APP_VERSION_TOO_LOW = -14001259;
	public static final int ERR_CODE_WRITE_MEMCACHE_ERROR = -14001260;
	public static final int ERR_CODE_EXECUTE_TIMEOUT = -14001261;
	public static final int ERR_CODE_CONNECT_SERVER_ERROR = -14001262;
	public static final int ERR_CODE_SPRING_INNER_SERVICE_FAILED = -14001263;
	public static final int ERR_CODE_INVOKE_THRIFT_SERVICE_TIMEOUT = -14001264;
	
	
	public static final Map<Integer, String> MAP_ERR_CODE_MSG = new HashMap<Integer, String>(0);
	
	static {
		MAP_ERR_CODE_MSG.put(ERR_CODE_SUCCESS, 						"success");
		MAP_ERR_CODE_MSG.put(ERR_CODE_LACK_PARAM, 					"缺少参数");
		MAP_ERR_CODE_MSG.put(ERR_CODE_THRIFT_RESPONSE_NULL, 			"Thrift服务没有响应");
		MAP_ERR_CODE_MSG.put(ERR_CODE_THRIFT_INSTANCE_NULL, 			"Thrift服务实例不存在");
		MAP_ERR_CODE_MSG.put(ERR_CODE_INVOKE_THRIFT_SERVICE_ERROR, 	"调用THRIFT服务出错");
		MAP_ERR_CODE_MSG.put(ERR_CODE_PARAM_ILLEGAL, 				"参数不符合规范");
		MAP_ERR_CODE_MSG.put(ERR_CODE_CALL_SERVICE_METHOD_ERROR, 	"调用内部方法失败");
		MAP_ERR_CODE_MSG.put(ERR_CODE_THRIFT_SERVICE_METHOD_NOT_EXIST, "THRIFT服务方法不存在");
		MAP_ERR_CODE_MSG.put(ERR_CODE_PARSE_RESPONSE_ERROR, 		"解析返回信息失败");
		MAP_ERR_CODE_MSG.put(ERR_CODE_PARSE_TICKET_ERROR, 			"解析票据信息失败");
		MAP_ERR_CODE_MSG.put(ERR_CODE_APP_VERSION_TOO_LOW, 			"app版本过低");
		MAP_ERR_CODE_MSG.put(ERR_CODE_WRITE_MEMCACHE_ERROR, 	    "写入MemCache失败");
		
		MAP_ERR_CODE_MSG.put(ERR_CODE_EXECUTE_TIMEOUT, 				"执行超时");
		MAP_ERR_CODE_MSG.put(ERR_CODE_CONNECT_SERVER_ERROR, 	    "长连接服务器地址不匹配");
		
		MAP_ERR_CODE_MSG.put(ERR_CODE_SPRING_INNER_SERVICE_FAILED, 	"调用内部服务出错");
		MAP_ERR_CODE_MSG.put(ERR_CODE_INVOKE_THRIFT_SERVICE_TIMEOUT, "调用Thrift接口超时");
	}
}
